home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / 1.2 / scripts / flatland.scm.z / flatland.scm
Text File  |  2002-07-08  |  2KB  |  70 lines

  1.  
  2. ; The GIMP -- an image manipulation program
  3. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  4. ; FlatLand - creates a tileable pattern that looks like a map
  5. ; Copyright (C) 1997 Adrian Likins
  6. ; This program is free software; you can redistribute it and/or modify
  7. ; it under the terms of the GNU General Public License as published by
  8. ; the Free Software Foundation; either version 2 of the License, or
  9. ; (at your option) any later version.
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ; GNU General Public License for more details.
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. ;
  19. ; FlatLand 
  20. ;
  21. ;    When used with the Land gradient It produces a tileble pattern that
  22. ;    looks a lot like a map. 
  23. ;
  24. ;    Should be really cool once map-sphere starts working again.
  25. ;
  26. ;    To use: open gradient editor, load the Land gradient then run the script.
  27. ;
  28. ;     Adrian Likins <aklikins@eos.ncsu.edu>
  29. ;
  30.  
  31.  
  32. (define (script-fu-flatland width height seed detail xscale yscale)
  33.   (let* (
  34.      (img (car (gimp-image-new width height RGB)))
  35.      (layer-one (car (gimp-layer-new img width height RGB "bottom" 100 NORMAL)))
  36.     )
  37.  
  38.   (gimp-image-undo-disable img)
  39.   (gimp-image-add-layer img layer-one 0)
  40.  ; (gimp-img-add-layer img layer-two 1)
  41.  
  42.   (plug-in-solid-noise 1 img layer-one 1 0 seed detail xscale yscale )
  43.   (plug-in-c-astretch 1 img layer-one)
  44.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  45.   (gimp-image-add-layer img layer-two -1)
  46.   (gimp-image-set-active-layer img layer-two)
  47.  
  48.   (plug-in-gradmap 1 img layer-two)
  49.   (gimp-image-undo-enable img)
  50.   (gimp-display-new img)
  51. ))
  52.  
  53. (script-fu-register "script-fu-flatland"
  54.             _"<Toolbox>/Xtns/Script-Fu/Patterns/Flatland..."
  55.             "A Land Pattern"
  56.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  57.             "Adrian Likins"
  58.             "1997"
  59.             ""
  60.             SF-ADJUSTMENT _"Image Width" '(256 10 2000 1 10 0 1)
  61.             SF-ADJUSTMENT _"Image Height" '(256 10 2000 1 10 0 1)
  62.             SF-ADJUSTMENT _"Random Seed" '(80 1 2000000 1 10 0 1)
  63.             SF-ADJUSTMENT _"Detail Level" '(3 1 15 1 10 1 0)
  64.             SF-ADJUSTMENT _"Scale X" '(4 0.1 16 0.1 2 1 1)
  65.             SF-ADJUSTMENT _"Scale Y" '(4 0.1 16 0.1 2 1 1))
  66.